package iqq.ui.view.panel.main;

import java.awt.BorderLayout;

import iqq.common.IQQConstants;
import iqq.ui.widget.StatusComboBox;
import iqq.util.ImageManager;
import iqq.util.ImageUtils;

import com.alee.extended.image.WebImage;
import com.alee.extended.panel.GroupPanel;
import com.alee.laf.label.WebLabel;
import com.alee.laf.panel.WebPanel;
import com.alee.laf.text.WebTextField;

/**
 * @author ChenZhiHui
 * @create-time 2013-3-10
 */
public class HeaderPl extends WebPanel {
	private static final long serialVersionUID = -1377283527033363798L;

	private WebImage faceImg;
	private StatusComboBox statusCbx;
	private WebLabel usernameLbl;
	private WebTextField signTextFld;
	private GroupPanel groupPanel;

	public HeaderPl() {
		initComponent();
		addComponent();
	}

	private void addComponent() {
		add(groupPanel);
	}

	private void initComponent() {
		faceImg = new WebImage(ImageUtils.getScaledInstance(
				ImageManager.getImageIcon(IQQConstants.ICON_DEF_QQ), 50, 50));
		statusCbx = new StatusComboBox();
		usernameLbl = new WebLabel("IQQ");
		usernameLbl.setMargin(5);
		signTextFld = new WebTextField("编辑个性签名22222");

		WebPanel pl = new WebPanel();
		pl.add(faceImg, BorderLayout.LINE_START);
		pl.add(new GroupPanel(false, new GroupPanel(true, usernameLbl,
				statusCbx), signTextFld), BorderLayout.CENTER);

		groupPanel = new GroupPanel(false, pl, new WebLabel("searcher"));
		groupPanel.setMargin(10, 10, 10, 20);
	}
}
